$(document).ready(function() {
			$("#account").blur(checkacc);
			$("#password").blur(checklogpwd);
			$("#capcode").click(changecaptcha);
			$("#cgc").click(changecaptcha);
			$("#tips").hide();
			$("#captcha").keyup(submitbutton);
			changecaptcha();
			getMessage();
		});
function getMessage() {
	var msg = $("#message").val();
	if (!checknull(msg)) {
		tipShow(msg);
	}
}
function checkLogin() {
	var cpfIpt = $("#captcha");
	if (cpfIpt.val().length==4) {
		if (checkacc() && checklogpwd()) {
			return true;
		} else {
			return false;
		}
	} else {
		tipShow("验证码不正确");
		changecaptcha();
		cpfIpt.focus();
		return false;
	}
}
function checkacc() {
	var accIpt = $("#account");
	var accstr = accIpt.val();
	if (!checknull(accstr) && !checkmin(accstr, 4) && !checkmax(accstr, 20)
			&& checkln(accstr)) {
		tipHide();
		return true;
	} else {
		tipShow("请输入正确的账号");
		return false;
	}
}
function checklogpwd() {
	var pwdIpt = $("#password");
	var pwdstr = pwdIpt.val();
	if (!checknull(pwdstr) && !checkmin(pwdstr, 6) && !checkmax(pwdstr, 32)) {
		tipHide();
		return true;
	} else {
		tipShow("请输入正确的密码");
		return false;
	}
}
function submitbutton(event) {
	//var evt = event!=null ? event : window.event;
	var k = event.keyCode || event.which;
	if (k == 13){//evt.keyCode == 13) {
		$("#loginBtn").click();
	}
}
function tipShow(str) {
	var tipDiv = $("#tips");
	tipDiv.html(str);
	tipDiv.show();
}
function tipHide() {
	var tipDiv = $("#tips");
	tipDiv.hide();
}